package com.it.dao;

import com.it.domain.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public  interface AdminMapper {
//    List<Admin> findAll();
//    int insert(Admin admin);


    Admin findByuse(@Param("username") String username, @Param("password") String password);

    void update(Admin admin);

    @Delete("delete from Admin where id = #{id}")
    int deleteById(int id);

    List<Admin> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,@Param("username")String username);

    @Select("select count(id) from tb_user")
    int selectTotal();

    @Select("select * from tb_user where id = #{id}")
    Admin SelectById(int id);
}
